package com.ricky.mq.client.message.model;

import com.ricky.mq.client.message.TextMsg;
import com.ricky.mq.client.session.BoringSession;

/**
 * 简单的广播模式
 *
 * @author ricky
 * @since 2020.06.18
 */
public class TextBoringTopic implements BoringTopic {

    /**
     * 主题名
     */
    private String topicName;
    /**
     * 最大容量
     */
    private int maxSize;

    /**
     * session对象
     */
    private BoringSession boringSession;

    public TextBoringTopic(String topicName, int maxSize, BoringSession boringSession) {
        this.topicName = topicName;
        this.boringSession = boringSession;
        this.maxSize = maxSize;
    }

    @Override
    public TextMsg createMsg() {
        return new TextMsg(this);
    }

    @Override
    public BoringSession getBoringSession() {
        return this.boringSession;
    }

    @Override
    public String getTopicName() {
        return topicName;
    }

    @Override
    public int getMaxSize() {
        return maxSize;
    }
}
